/**
 * Project Name:SimonFramework
 * File Name:ImageScaleType.java
 * Package Name:com.simon.framework.image.core.assist
 * Date:2016-5-19 下午3:52:52
 * Copyright (c) 2016, simon@cmonbaby.com All Rights Reserved.
 */
package com.cmonbaby.images.core.assist;

/**
 * <p>Author:      Simon
 * <p>QO:          8950764
 * <p>Email:       simon@cmonbaby.com
 * <p>WebSize:     https://www.cmonbaby.com
 * <p>Version:     1.0.0
 * <p>Date:        2020/12/29
 * <p>Description: 解码时图片缩放的类型
 */
public enum ImageScaleType {

    /** Image won't be scaled */
    NONE,
    /**
     * Image will be scaled down only if image size is greater than
     * {@linkplain javax.microedition.khronos.opengles.GL10#GL_MAX_TEXTURE_SIZE maximum acceptable texture size}.
     * Usually it's 2048x2048.<br />
     * If Bitmap is expected to display than it must not exceed this size (otherwise you'll get the exception
     * "OpenGLRenderer: Bitmap too large to be uploaded into a texture".<br />
     * Image will be subsampled in an integer number of times (1, 2, 3, ...) to maximum texture size of device.
     */
    NONE_SAFE,
    /**
     * Image will be reduces 2-fold until next reduce step make image smaller target size.<br />
     * It's <b>fast</b> type and it's preferable for usage in lists/grids/galleries (and other
     * {@linkplain android.widget.AdapterView adapter-views}) .<br />
     * Relates to {@link android.graphics.BitmapFactory.Options#inSampleSize}<br />
     * Note: If original image size is smaller than target size then original image <b>won't</b> be scaled.
     */
    IN_SAMPLE_POWER_OF_2,
    /**
     * Image will be subsampled in an integer number of times (1, 2, 3, ...). Use it if memory economy is quite
     * important.<br />
     * Relates to {@link android.graphics.BitmapFactory.Options#inSampleSize}<br />
     * Note: If original image size is smaller than target size then original image <b>won't</b> be scaled.
     */
    IN_SAMPLE_INT,
    /**
     * Image will scaled-down exactly to target size (scaled width or height or both will be equal to target size;
     * depends on {@linkplain android.widget.ImageView.ScaleType ImageView's scale type}). Use it if memory economy is
     * critically important.<br />
     * <b>Note:</b> If original image size is smaller than target size then original image <b>won't</b> be scaled.<br />
     * <br />
     * <b>NOTE:</b> For creating result Bitmap (of exact size) additional Bitmap will be created with
     * {@link android.graphics.Bitmap#createBitmap(android.graphics.Bitmap, int, int, int, int, android.graphics.Matrix, boolean)
     * Bitmap.createBitmap(...)}.<br />
     * <b>Cons:</b> Saves memory by keeping smaller Bitmap in memory cache (comparing with IN_SAMPLE... scale types)<br />
     * <b>Pros:</b> Requires more memory in one time for creation of result Bitmap.
     */
    EXACTLY,
    /**
     * Image will scaled exactly to target size (scaled width or height or both will be equal to target size; depends on
     * {@linkplain android.widget.ImageView.ScaleType ImageView's scale type}). Use it if memory economy is critically
     * important.<br />
     * <b>Note:</b> If original image size is smaller than target size then original image <b>will be stretched</b> to
     * target size.<br />
     * <br />
     * <b>NOTE:</b> For creating result Bitmap (of exact size) additional Bitmap will be created with
     * {@link android.graphics.Bitmap#createBitmap(android.graphics.Bitmap, int, int, int, int, android.graphics.Matrix, boolean)
     * Bitmap.createBitmap(...)}.<br />
     * <b>Cons:</b> Saves memory by keeping smaller Bitmap in memory cache (comparing with IN_SAMPLE... scale types)<br />
     * <b>Pros:</b> Requires more memory in one time for creation of result Bitmap.
     */
    EXACTLY_STRETCHED

}

